import request from '@/utils/request'

// 获取路由
export const getRouters = () => {
  return request({
    url: '/getMenu',
    method: 'get'
  })
}
// 查询菜单树
export function treeMenu(data) {
  return request({
    url: '/sys/menu/tree',
    method: 'get',
    params: data
  })
}
// 查询菜单列表
export function listMenu(par) {
  return request({
    url: '/sys/menu/list',
    method: 'get',
    params: par
  })
}

// 修改菜单
export function saveMenu(data) {
  return request({
    url: '/sys/menu/save',
    method: 'post',
    data: data
  })
}

// 删除菜单
export function delMenu(menuId) {
  return request({
    url: '/sys/menu/delete',
    method: 'delete',
    params: { menuId: menuId }
  })
}
